package com.dup.jxlh.api.enums;

public enum LevelEnum {
    COMPANY(1, "公司级"),
    DEPARTMENT(2, "部门级"),
    PERSON(3, "员工级");

    private Integer code;
    private String name;

    LevelEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (LevelEnum stateEnum: values()){
            if(stateEnum.getCode() == code){
                return stateEnum.getName();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
